package 动态规划.背包问题;

/**
 * @ClassName _518零钱兑换II
 * @Description TODO
 * @Author 昝亚杰
 * @Date 2022/1/10 19:59
 * Version 1.0
 **/
public class _518零钱兑换II {
    public int change(int amount, int[] coins) {
        int count = 0;
        int[] result = new int[amount + 1];
        result[0] = 1;
        for(int i = 0; i < coins.length; i++){
            for(int j = coins[i]; j <= amount; j++){
                result[j] += result[j - coins[i]];
            }
        }
        return result[amount];
    }
}
